<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../../common/tag.jsp"%>
<html>
<head>
<title>消息自动回复设置</title>
<meta name="referrer" content="never">
<%@ include file="../../common/header.jsp"%>
<link href="${ctx }/css/plugins/validator/validator.css"
	rel="stylesheet">
<link href="${ctx }/css/plugins/dataTables/datatables.min.css"
	rel="stylesheet">
</head>
<body class="gray-bg">

	<div class="wrapper wrapper-content animated fadeIn">



		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>消息自动回复设置</h5>

						<div class="ibox-tools">
							<!-- <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a> -->
						</div>
					</div>
				</div>

				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>基本设置</h5>

					</div>
					<div class="ibox-content">
						<form class="form-horizontal" action="${ctx }/weixin/saveReplyMsg"
							id="myForm" method="post" role="form">
							<div class="form-group">
								<label class="col-sm-3 control-label"><span
									style="color: red">*</span>回复类型</label>
								<div class="col-sm-6">
									<select class="form-control" id="replyType" name="replyType">
										<option value="subscription"
											<c:if test="${msgReply.replyType=='subscription'}">selected="selected"</c:if>>关注回复</option>
										<option value="auto"
											<c:if test="${msgReply.replyType=='auto'}">selected="selected"</c:if>>自动回复</option>
										<option value="keyword"
											<c:if test="${msgReply.replyType=='keyword'}">selected="selected"</c:if>>关键字回复</option>
									</select>
								</div>
							</div>
							<div class="form-group" id="keywordContainer"
								style="display: none;">
								<label class="col-sm-3 control-label">关键字</label>
								<div class="col-sm-6">
									<input class="form-control" id="keyword" name="keyword"
										placeholder="请输入关键字" type="text" value="${msgReply.keyword }">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label"><span
									style="color: red">*</span>消息类型</label>
								<div class="col-sm-6">
									<select class="form-control" id="msgType" name="msgType">
										<option value="text"
											<c:if test="${msgReply.msgType=='text'}">selected="selected"</c:if>>文本</option>
										<option value="image"
											<c:if test="${msgReply.msgType=='image'}">selected="selected"</c:if>>图片</option>
										<option value="news"
											<c:if test="${msgReply.msgType=='news'}">selected="selected"</c:if>>图文</option>
									</select>
								</div>
							</div>
							<div class="form-group" id="replyTextContainer">
								<label class="col-sm-3 control-label">文本内容</label>
								<div class="col-sm-6">
									<textarea class="form-control" cols="20" id="replyText"
										name="replyText" placeholder="回复文本" rows="4"
										value="${msgReply.replyText }">${msgReply.replyText }</textarea>
								</div>
							</div>
							<div class="form-group" id="picContainer" style="display: none;">
								<label class="col-sm-3 control-label">图片内容</label>
								<div class="col-sm-6">
									<div class="input-group">
										<input class="form-control" id="imageMediaId"
											name="imageMediaId" placeholder="请选择图片" type="text"
											readonly="readonly" value="${msgReply.mediaId }" /> <span
											class="input-group-btn">
											<button type="button" class="btn btn-primary"
												onclick="fileIcon.click()">...</button> <input type="file"
											id="fileIcon" name="fileIcon" class="opacity_0"
											style="display: none;">
										</span>
									</div>
								</div>
							</div>
							<div class="form-group" id="newsContainer" style="display: none;">
								<label class="col-sm-3 control-label">图文内容</label>
								<div class="col-sm-6">
									<div class="input-group">
										<input class="form-control" id="newsMediaId"
											name="newsMediaId" placeholder="请选择图文" type="text"
											readonly="readonly" value="${msgReply.mediaId }" /> <span
											class="input-group-btn">
											<button type="button" id="btnSelectNews"
												class="btn btn-primary">...</button>
										</span>
									</div>
								</div>
							</div>
							<div class="form-group">
								<div class="col-sm-4 col-sm-offset-3">
									<button type="button" id="btnSave" class="btn btn-primary">保
										存</button>
									<button type="button" id="btnClose" class="btn btn-default">取
										消</button>
									<input type="hidden" id="id" name="id" value="${msgReply.id }" />
									<input type="hidden" id="mediaId" name="mediaId"
										value="${msgReply.mediaId }" />
								</div>
							</div>
						</form>
					</div>
				</div>


			</div>

			<div class="col-lg-4"></div>
		</div>

	</div>


	<div id="showNewsModal" class="modal fade">
		<div class="modal-dialog" style="width: 800px;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title">选择图文素材</h4>
				</div>

				<div class="modal-body">

					<div class="table-responsive">
						<div class="dataTables_info" id="DataTables_Table_0_info"
							role="status" aria-live="polite">
							总共：<span id="item_total">0</span>
						</div>
						<table class="table table-striped table-bordered table-hover">
							<thead>
								<tr>
									<th>标题</th>
									<th>缩略图</th>
									<th>摘要</th>
									<th>选择</th>
								</tr>
							</thead>
							<tbody id="newsContent">

							</tbody>
						</table>
						<div class="dataTables_paginate paging_simple_numbers">

							<ul class="pagination">
								<li class="paginate_button previous"
									id="DataTables_Table_0_previous"><a href="#"
									aria-controls="DataTables_Table_0">上一页</a></li>
								<li class="paginate_button next disabled"
									id="DataTables_Table_0_next"><a href="#"
									aria-controls="DataTables_Table_0">下一页</a></li>
							</ul>
						</div>
					</div>
				</div>


				<div class="modal-footer">
					<button type="button" id="btnSaveNews" class="btn btn-primary">保
						存</button>
					<button type="button" id="btnCloseBind" class="btn btn-default"
						data-dismiss="modal">取 消</button>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
<%@ include file="../../common/footer.jsp"%>
<script src="${ctx }/js/plugins/validator/validator.js"></script>
<script src="${ctx }/js/plugins/ajaxfileupload.js"></script>
<script>
	var options = {

	};
</script>
<script src="${ctx }/js/view/weixin/msgReplyEdit.js"></script>
